* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部导航样式 */
.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 2rem;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav ul li a:hover {
    background-color: #34495e;
}

/* 导航激活状态 */
.nav ul li a.active {
    background-color: #34495e;
    position: relative;
}

.nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background-color: #fff;
}

/* 主要内容区样式 */
.main-content {
    flex: 1;
    display: flex;
    position: relative;
    padding: 2rem;
    gap: 2rem;
}

/* 侧边栏样式优化 */
.sidebar {
    width: 300px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.weather-card {
    padding: 0.5rem;
}

.weather-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-card h3::before {
    content: '📊';
    font-size: 1.4rem;
}

.weather-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.weather-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.weather-item-label {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #34495e;
    font-weight: 500;
}

.weather-item-icon {
    font-size: 1.5rem;
}

.weather-item-value {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.1rem;
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    min-width: 90px;
    text-align: center;
}

/* 添加数据更新动画 */
@keyframes update-flash {
    0% { background-color: #f8f9fa; }
    50% { background-color: #e9ecef; }
    100% { background-color: #f8f9fa; }
}

.value-update {
    animation: update-flash 1s ease;
}

/* 添加实时更新提示 */
.realtime-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #666;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #ddd;
}

.realtime-dot {
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* 主内容区样式 */
.content {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-container {
    margin-bottom: 2rem;
}

.alert-container {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

/* 底部样式 */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

/* 数据总览卡片样式 */
.overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.card-content h4 {
    color: #666;
    margin-bottom: 0.5rem;
}

.card-content p {
    font-size: 1.25rem;
    font-weight: bold;
    color: #2c3e50;
}

/* 信息区域布局 */
.info-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

/* 天气预报区域样式 */
.weather-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%; /* 确保占满容器宽度 */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.section-header h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.current-weather {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-temp {
    font-size: 2rem;
    font-weight: 600;
    color: #2c3e50;
}

.current-desc {
    color: #666;
    font-size: 1.1rem;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.weather-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.weather-icon {
    font-size: 1.5rem;
}

.weather-label {
    color: #666;
    font-size: 0.9rem;
}

.weather-value {
    color: #2c3e50;
    font-weight: 500;
}

/* 天气预报样式 */
.forecast-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin: 1.5rem 0;
    overflow: hidden;
}

.forecast-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.forecast-header h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
}

.forecast-update-time {
    font-size: 0.9rem;
    color: #666;
}

.forecast-content {
    background: linear-gradient(135deg, #00b4db, #0083b0);
    padding: 1.5rem;
}

.forecast-list {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
}

.forecast-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    color: white;
    backdrop-filter: blur(5px);
}

.forecast-date {
    margin-bottom: 0.8rem;
}

.date-day {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.date-full {
    font-size: 0.85rem;
    opacity: 0.8;
}

.weather-icon {
    font-size: 2rem;
    margin: 1rem 0;
}

.weather-temp {
    margin: 0.8rem 0;
}

.temp-max {
    font-size: 1.2rem;
    font-weight: 600;
}

.temp-min {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

.weather-desc {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.weather-wind {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* 响应式布局 */
@media (max-width: 1024px) {
    .forecast-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .forecast-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .forecast-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .forecast-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 农事建议样式 */
.farming-advice {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.advice-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.advice-item {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.advice-icon {
    font-size: 1.5rem;
    margin-right: 1rem;
}

.advice-content h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.advice-content p {
    color: #666;
    line-height: 1.4;
}

/* 页面切换动画 */
.page-content {
    animation: fadeIn 0.3s ease-in forwards;
    width: 100%;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 生长调控页面特定样式 */
.crop-select {
    margin: 1rem 0;
}

.crop-select select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f8f9fa;
}

.stage-progress {
    background: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    margin: 1rem 0;
    overflow: hidden;
}

.stage-bar {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    color: white;
    font-size: 0.8rem;
}

.stage-info {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.status {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.status.optimal { background: #E8F5E9; color: #2E7D32; }
.status.warning { background: #FFF3E0; color: #E65100; }
.status.normal { background: #E3F2FD; color: #1565C0; }
.status.low { background: #FFEBEE; color: #C62828; }

.control-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-control {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: #e9ecef;
}

.optimal-range {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* 病虫防治页面样式 */
.pest-control-container {
    padding: 20px;
    background-color: #f5f7fa;
}

/* 统计卡片样式 */
.statistics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5em;
    margin-right: 20px;
    color: #4CAF50;
}

.stat-info h3 {
    margin: 0;
    font-size: 1em;
    color: #666;
}

.stat-info p {
    margin: 5px 0 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

/* 病虫害列表样式 */
.pest-list {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.add-pest-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s;
}

.add-pest-btn:hover {
    background: #45a049;
}

/* 病虫害卡片样式 */
.pest-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.pest-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.pest-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.pest-image {
    height: 200px;
    overflow: hidden;
}

.pest-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pest-info {
    padding: 20px;
}

.pest-info h3 {
    margin: 0 0 10px;
    color: #333;
}

.pest-info p {
    margin: 5px 0;
    color: #666;
}

.pest-info i {
    margin-right: 8px;
    color: #4CAF50;
}

.pest-status {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    margin: 10px 0;
}

.pest-status.processing {
    background: #fff3cd;
    color: #856404;
}

.pest-status.completed {
    background: #d4edda;
    color: #155724;
}

.pest-treatment {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pest-treatment h4 {
    margin: 0 0 8px;
    color: #333;
    font-size: 0.9em;
}

/* 响应式布局调整 */
@media (min-width: 1200px) {
    .info-section {
        grid-template-columns: 1fr; /* 改为单列布局 */
        max-width: 1200px; /* 限制最大宽度 */
        margin: 1.5rem auto; /* 居中显示 */
    }
}

@media (max-width: 768px) {
    .forecast-list {
        grid-template-columns: repeat(4, 1fr);
        padding: 1rem;
    }
    
    .forecast-item {
        padding: 0.8rem 0.4rem;
    }
    
    .forecast-item:nth-child(4)::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .forecast-list {
        grid-template-columns: repeat(3, 1fr);
        padding: 0.8rem;
    }
    
    .forecast-item:nth-child(3)::after {
        display: none;
    }
}

/* 天气预报容器 */
.weather-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.weather-header h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.weather-current {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-temp {
    font-size: 2.2rem;
    font-weight: 600;
    color: #2c3e50;
}

.current-info {
    text-align: right;
}

.current-desc {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.current-wind {
    font-size: 0.9rem;
    color: #666;
}

/* 一周天气预报样式 */
.weather-week-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 1.5rem 0;
    overflow: hidden;
}

.weather-week-header {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.weather-week-header h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
}

.weather-update-time {
    font-size: 0.9rem;
    color: #666;
}

.weather-week-list {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #00b4db, #0083b0);
    padding: 1.5rem;
    gap: 1rem;
}

.weather-week-item {
    text-align: center;
    color: white;
    position: relative;
    padding: 1rem 0.5rem;
}

.weather-week-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -0.5rem;
    top: 10%;
    height: 80%;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.weather-date {
    margin-bottom: 1rem;
}

.date-day {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.date-full {
    font-size: 0.85rem;
    opacity: 0.8;
}

.weather-icon {
    font-size: 2.2rem;
    margin: 1rem 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.weather-temp {
    margin: 1rem 0;
}

.temp-max {
    font-size: 1.1rem;
    font-weight: 600;
}

.temp-min {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

.weather-desc {
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.weather-wind {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 响应式布局 */
@media (max-width: 1024px) {
    .weather-week-list {
        grid-template-columns: repeat(4, 1fr);
        padding: 1.2rem;
    }
    
    .weather-week-item:nth-child(4)::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .weather-week-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .weather-week-list {
        grid-template-columns: repeat(3, 1fr);
        padding: 1rem;
        gap: 0.8rem;
    }
    
    .weather-week-item:nth-child(3)::after {
        display: none;
    }
    
    .weather-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .weather-week-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .weather-week-item:nth-child(2)::after {
        display: none;
    }
} 